﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using entity;
using Newtonsoft.Json;
using System.Text;
public partial class product : Basic
{
    public string productActivic = "";//产品动态
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            productActivic = ProductActivic();
        }
    }

    // 0404
    public string ProductActivic()
    {
        StringBuilder sb = new StringBuilder();
        string title = "";
        string str_cpdt = UrlGet.Get("news/NewsListMany.ashx?typeid=0404&top=7");
        if (string.IsNullOrEmpty(str_cpdt))
        {
            sb.AppendLine("<li>暂无产品动态信息 </li>");
            return sb.ToString();
        }
        #region 产品动态信息列表
        var list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<NewsList>>(str_cpdt);
        foreach (var item in list)
        {

            for (int i = 0; i < item.list.Length; i++)
            {
                title = item.list[i].Title;
                if (!string.IsNullOrEmpty(title))
                {
                    if (title.Length > 18)
                    {
                        title = title.Substring(0, 18) + "...";
                    }
                }

                sb.AppendLine("<li style=\"overflow:hidden; height:20px;\"> ·<a href=\"" + GetNewsUrl("15", "0404", item.list[i].Id) + "\"  target=\"_blank\">" + title + "</a> </li>");

            }

        }
        #endregion
        return sb.ToString();
    }

}